<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div:nth-child(1){
            width: 100px;
            height: 100px;
            margin: 100px auto;
            background-color: pink;
            transition: all .5s;
        }
        div:nth-child(1):hover{
            /* 旋转 360deg(度) */
            transform: rotate(360deg);
        }
        div:nth-child(2){
            width: 100px;
            height: 100px;
            margin: 100px auto;
            background-color: rgb(48, 30, 214);
            transition: all .5s;
            /* 设置旋转中心点 后面参数是x y，
              默认 50% 50%是在正中间 
              可以用像素px设置也可以用方位词组合设置（top left  bottom right）*/
            
            transform-origin:top left ;
        }
        div:nth-child(2):hover{
            /* 旋转 360deg(度) */
            transform: rotate(360deg);
        }
    </style>
</head>
<body>
    <div></div>
    <div></div>
</body>
</html>